package pATT.help.visual;

import java.awt.HeadlessException;

import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;

@SuppressWarnings("serial")
public class HelpFrame extends JDialog {
	
	private JPanel jContentPane = null;
	private JScrollPane jBodyScrollPane = null;
	private JButton jOKButton = null;
	private JTextArea jBodyTextArea = null;
	
	public HelpFrame(String title, String body) throws HeadlessException {
		super();
		initialize(title,body);
	}
	
	
	/**
	 * This method initializes jBodyScrollPane	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getJBodyScrollPane() {
		if (jBodyScrollPane == null) {
			jBodyScrollPane = new JScrollPane();
			jBodyScrollPane.setBounds(new java.awt.Rectangle(7,2,648,311));
			jBodyScrollPane.setViewportView(getJBodyTextArea());
		}
		return jBodyScrollPane;
	}
	
	/**
	 * This method initializes jOKButton	
	 * 	
	 * @return javax.swing.JButton	
	 */
	private JButton getJOKButton() {
		if (jOKButton == null) {
			jOKButton = new JButton();
			jOKButton.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
			jOKButton.setBounds(new java.awt.Rectangle(267,320,81,26));
			jOKButton.setText("OK");
			jOKButton.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					dispose();
				}
			});
		}
		return jOKButton;
	}
	
	/**
	 * This method initializes jBodyTextArea	
	 * 	
	 * @return javax.swing.JTextArea	
	 */
	private JTextArea getJBodyTextArea() {
		if (jBodyTextArea == null) {
			jBodyTextArea = new JTextArea();
			jBodyTextArea.setEditable(false);
		}
		return jBodyTextArea;
	}
	
	
	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize(String title, String body) {
		this.setLocation(0,0);
		this.setSize(669, 385);
		this.setContentPane(getJContentPane());
		this.setTitle(title);
		this.getJBodyTextArea().setText(body);
		this.setModal(true);
	}
	
	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jContentPane = new JPanel();
			jContentPane.setLayout(null);
			jContentPane.add(getJBodyScrollPane(), null);
			jContentPane.add(getJOKButton(), null);
		}
		return jContentPane;
	}
	
}  //  @jve:decl-index=0:visual-constraint="10,10"
